Fix: Stabilize dubbo-config-spring propertyconfigurer-related tests by Disabling Metrics Initialization and Ensuring Test Isolation#15841
Merged
RainYuY merged 1 commit intoapache:3.3from Jan 15, 2026
Conversation
4 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 3.3 #15841 +/- ##
============================================
- Coverage 60.77% 60.77% -0.01%
+ Complexity 11705 11701 -4
============================================
Files 1938 1938
Lines 88692 88692
Branches 13387 13387
============================================
- Hits 53906 53899 -7
- Misses 29253 29257 +4
- Partials 5533 5536 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change?
This PR stabilizes propertyconfigurer-related tests inside
dubbo-config-springthat were intermittently failing under randomized execution orders (NonDex) due to shared Dubbo/Spring framework state leaking across test boundaries. The following tests were consistently among the flaky failures before this fix, but now pass reliably across all NonDex seeds:testEarlyInittestEarlyInittestImportPropertySource,testCustomPropertySourceBeanRoot Cause
These failures are identical to previously fixed issues in:
ExporterSideConfigUrlTestby disabling metrics initialization during URL export #15778MethodConfigTestby disabling metrics initialization to avoid Micrometer nondeterminism #15782ServiceConfigTestby isolating system properties and cached state #15785Each of those PRs addressed flakiness caused by Micrometer’s
CompositeMeterRegistry, which can throw anArrayIndexOutOfBoundsExceptionwhen it iterates over internalIdentityHashMapstructures under randomized execution orders (NonDex).The tests mentioned above suffered from the same underlying issue:
Dubbo framework state was leaking between test methods. This meant that the behavior of reference creation in one test could affect subsequent tests, causing nondeterministic failures.
Changes Made
To fully isolate each test method and eliminate shared state, the following changes were applied:
SysProps.clear()in the lifecycle hooks to avoid cross-test pollution.DubboBootstrap.reset()to ensure isolation between tests.Verification
You can try running the following snippet of code from the dubbo repo root, on both pre-fix and post-fix code
The tests should fail intermittently on the pre-fix version, but pass consistently across all seeds on the post-fix version.
NonDex run logs will be available under the
dubbo-config/dubbo-config-spring/.nondexdirectory.Checklist